#include <stdio.h>
#include <windows.h>

#include "hs_time.h"

i64 freq, start;

void time_init() {
    QueryPerformanceFrequency((PLARGE_INTEGER)&freq);
    QueryPerformanceCounter((PLARGE_INTEGER)&start);
    start = ((1000 * start) / freq);
}

int time() {
    i64 current = 0;
    QueryPerformanceCounter((PLARGE_INTEGER)&current);
    return ((1000 * current) / freq);
}

int time_start() {
    return start;
}
